with Ada.Text_IO;              use Ada.Text_IO;
with Ada.Strings.Unbounded;    use Ada.Strings.Unbounded;
with Ada.Containers.Vectors;   use Ada.Containers;

package LibMoulinette is

      type Societe is
      record
	 Nom         : Unbounded_String;
	 Code_Client : Unbounded_String;
	 Cp          : Unbounded_String;
	 Ville       : Unbounded_String;
      end record;

   type Facture is
      record
	 Code_Client    : Unbounded_String;
	 Numero_Facture : Unbounded_String;
	 Date_Facture   : Unbounded_String;
	 Total_Ht       : Unbounded_String;
	 Total_Tva      : Unbounded_String;
	 Total_Ttc      : Unbounded_String;
      end record;

   type Facture_Detail is
      record
	 Numero_Facture : Unbounded_String;
	 Description    : Unbounded_String;
	 Taux_Tva       : Unbounded_String;
	 Quantite       : Unbounded_String;
	 Total_Ht       : Unbounded_String;
	 Total_Tva      : Unbounded_String;
	 Total_Ttc      : Unbounded_String;
      end record;

   package Societe_Vector is new Vectors (Natural, Societe);
   package Details_Vector is new Vectors (Natural, Facture_Detail);
   package Unbounded_String_Vector is new Vectors (Natural, Unbounded_String);

   function Get_Societe    (Line : Unbounded_String) return Societe;
   function Get_Detail     (Line : Unbounded_String) return Facture_Detail;
   function Get_All_Details(Line : Unbounded_String) return Details_Vector.Vector;

   function Societe_Vector_Removedups(Vect_Societe : Societe_Vector.Vector) return Societe_Vector.Vector;
   function Gen_Facture(Vect_Details : Details_Vector.Vector) return Facture;


   procedure Societe_Vector_Dump(Vect_Societe : Societe_Vector.Vector);
   procedure Details_Dump       (Vect_Details : Details_Vector.Vector);
   procedure Facture_Dump       (Fact : Facture);

   procedure Process_Dump( Dump_Path : String
			 ; Dest_Root : String);

end LibMoulinette;
